/*
 * @authors :Bin Mei
 * @date    :2017-05-22
 * @description：票交汇M站
 */

import { StaticToast} from 'pjh-mobile-ui';
import {mFetch} from 'min-bridge';

export const  NOTICE_LIST = "NOTICE_LIST";
export const  NOTICE_PAGES = "NOTICE_PAGES";

let notice =  {
	
	notice_list:(options)=>{
		return (dispatch)=>{
			let {bizContent,success,error} = options;
			mFetch.fetchJson({
				// url:"/app/phjApi/mock/more.noticeList",
				data:{
					method:"more.noticeList",
					bizContent
				},
				success:res=>{
					if(res.code == "0000"){
						let {list}=res.data;
						dispatch({
							type: (bizContent.pageNum <= 1 ? NOTICE_LIST : NOTICE_PAGES),
							data:(list||[])
						});
					}else{
						StaticToast.error(res.message);
					};
					success&&success(res,dispatch);
				},
				error
			});

		};
	},

	
};
export default notice;


